package fmod.fmod;

import zombie.characters.IsoGameCharacter;
import zombie.characters.IsoPlayer;
import zombie.iso.IsoObject;

/* loaded from: FMODFootstep.class */
public class FMODFootstep {
    public String wood;
    public String concrete;
    public String grass;
    public String upstairs;
    public String woodCreak = "HumanFootstepFloorCreaking";

    public FMODFootstep(String str, String str2, String str3, String str4) {
        this.grass = str;
        this.wood = str2;
        this.concrete = str3;
        this.upstairs = str4;
    }

    public boolean isUpstairs(IsoGameCharacter isoGameCharacter) {
        if (IsoPlayer.getInstance().getCurrentSquare().getZ() < isoGameCharacter.getCurrentSquare().getZ()) {
            return true;
        }
        return false;
    }

    public String getSoundToPlay(IsoGameCharacter isoGameCharacter) {
        if (FMODManager.instance.getNumListeners() == 1) {
            int i = 0;
            while (true) {
                if (i >= IsoPlayer.numPlayers) {
                    break;
                }
                IsoPlayer isoPlayer = IsoPlayer.players[i];
                if (isoPlayer == null || isoPlayer == isoGameCharacter || isoPlayer.Traits.Deaf.isSet()) {
                    i++;
                } else if (((int) isoPlayer.getZ()) < ((int) isoGameCharacter.getZ())) {
                    return this.upstairs;
                }
            }
        }
        IsoObject floor = isoGameCharacter.getCurrentSquare().getFloor();
        if (floor != null && floor.getSprite() != null && floor.getSprite().getName() != null) {
            String name = floor.getSprite().getName();
            if (name.startsWith("blends_natural_01")) {
                return this.grass;
            }
            if (name.startsWith("floors_interior_tilesandwood_01_")) {
                int parseInt = Integer.parseInt(name.replaceFirst("floors_interior_tilesandwood_01_", ""));
                if (parseInt > 40 && parseInt < 48) {
                    return this.wood;
                }
                return this.concrete;
            }
            if (name.startsWith("carpentry_02_")) {
                return this.wood;
            }
            if (name.startsWith("floors_interior_carpet_")) {
                return this.wood;
            }
            return this.concrete;
        }
        return this.concrete;
    }
}